package com.Thread常用API.取名字;

public class ThreadDemo {
    public static void main(String[] args) {
        Thread thread = new Thread(new MyThread());
        thread.setName("1号线程");
        thread.start();

        Thread thread2 = new Thread(new MyThread());
        thread2.setName("2号线程");
        thread2.start();


        for (int i = 0; i < 5; i++) {
            System.out.println("main线程"+i);
        }
    }
}
